\(\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx\) [320]
Optimal result
Integrand size = 31, antiderivative size = 272 \[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=-\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^4 d}+\frac {2 a^2 \left (2 a^2 A b-3 A b^3-3 a^3 B+4 a b^2 B\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^4 (a+b)^{3/2} d}+\frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}
\]
[Out]
-1/2*(4*A*a*b-6*B*a^2-B*b^2)*arctanh(sin(d*x+c))/b^4/d+2*a^2*(2*A*a^2*b-3*A*b^3-3*B*a^3+4*B*a*b^2)*arctanh((a-
b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(3/2)/b^4/(a+b)^(3/2)/d+(2*A*a^2*b-A*b^3-3*B*a^3+2*B*a*b^2)*tan
(d*x+c)/b^3/(a^2-b^2)/d-1/2*(2*A*a*b-3*B*a^2+B*b^2)*sec(d*x+c)*tan(d*x+c)/b^2/(a^2-b^2)/d+a*(A*b-B*a)*sec(d*x+
c)^2*tan(d*x+c)/b/(a^2-b^2)/d/(a+b*sec(d*x+c))
Rubi [A] (verified)
Time = 0.96 (sec) , antiderivative size = 272, normalized size of antiderivative = 1.00, number of
steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.258, Rules used = {4114, 4177, 4167, 4083, 3855,
3916, 2738, 214} \[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=-\frac {\left (-6 a^2 B+4 a A b-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^4 d}+\frac {a (A b-a B) \tan (c+d x) \sec ^2(c+d x)}{b d \left (a^2-b^2\right ) (a+b \sec (c+d x))}-\frac {\left (-3 a^2 B+2 a A b+b^2 B\right ) \tan (c+d x) \sec (c+d x)}{2 b^2 d \left (a^2-b^2\right )}+\frac {2 a^2 \left (-3 a^3 B+2 a^2 A b+4 a b^2 B-3 A b^3\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^4 d (a-b)^{3/2} (a+b)^{3/2}}+\frac {\left (-3 a^3 B+2 a^2 A b+2 a b^2 B-A b^3\right ) \tan (c+d x)}{b^3 d \left (a^2-b^2\right )}
\]
[In]
Int[(Sec[c + d*x]^4*(A + B*Sec[c + d*x]))/(a + b*Sec[c + d*x])^2,x]
[Out]
-1/2*((4*a*A*b - 6*a^2*B - b^2*B)*ArcTanh[Sin[c + d*x]])/(b^4*d) + (2*a^2*(2*a^2*A*b - 3*A*b^3 - 3*a^3*B + 4*a
*b^2*B)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(3/2)*b^4*(a + b)^(3/2)*d) + ((2*a^2*A*b
- A*b^3 - 3*a^3*B + 2*a*b^2*B)*Tan[c + d*x])/(b^3*(a^2 - b^2)*d) - ((2*a*A*b - 3*a^2*B + b^2*B)*Sec[c + d*x]*
Tan[c + d*x])/(2*b^2*(a^2 - b^2)*d) + (a*(A*b - a*B)*Sec[c + d*x]^2*Tan[c + d*x])/(b*(a^2 - b^2)*d*(a + b*Sec[
c + d*x]))
Rule 214
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 3855
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3916
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a/b)*Si
n[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]
Rule 4083
Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]
Rule 4114
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Simp[a*d^2*(A*b - a*B)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*((d*Csc[e + f*x])
^(n - 2)/(b*f*(m + 1)*(a^2 - b^2))), x] - Dist[d/(b*(m + 1)*(a^2 - b^2)), Int[(a + b*Csc[e + f*x])^(m + 1)*(d*
Csc[e + f*x])^(n - 2)*Simp[a*d*(A*b - a*B)*(n - 2) + b*d*(A*b - a*B)*(m + 1)*Csc[e + f*x] - (a*A*b*d*(m + n) -
d*B*(a^2*(n - 1) + b^2*(m + 1)))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a
*B, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1] && GtQ[n, 1]
Rule 4167
Int[csc[(e_.) + (f_.)*(x_)]*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_
.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m
+ 2))), x] + Dist[1/(b*(m + 2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*A*(m + 2) + b*C*(m + 1) + (b*
B*(m + 2) - a*C)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Rule 4177
Int[csc[(e_.) + (f_.)*(x_)]^2*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(
e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[(-C)*Csc[e + f*x]*Cot[e + f*x]*((a + b*Csc[e + f*x])^
(m + 1)/(b*f*(m + 3))), x] + Dist[1/(b*(m + 3)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[a*C + b*(C*(m +
2) + A*(m + 3))*Csc[e + f*x] - (2*a*C - b*B*(m + 3))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B, C,
m}, x] && NeQ[a^2 - b^2, 0] && !LtQ[m, -1]
Rubi steps \begin{align*}
\text {integral}& = \frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\int \frac {\sec ^2(c+d x) \left (2 a (A b-a B)-b (A b-a B) \sec (c+d x)-\left (2 a A b-3 a^2 B+b^2 B\right ) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{b \left (a^2-b^2\right )} \\ & = -\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\int \frac {\sec (c+d x) \left (-a \left (2 a A b-3 a^2 B+b^2 B\right )+b \left (2 a A b-a^2 B-b^2 B\right ) \sec (c+d x)+2 \left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{2 b^2 \left (a^2-b^2\right )} \\ & = \frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\int \frac {\sec (c+d x) \left (-a b \left (2 a A b-3 a^2 B+b^2 B\right )-\left (a^2-b^2\right ) \left (4 a A b-6 a^2 B-b^2 B\right ) \sec (c+d x)\right )}{a+b \sec (c+d x)} \, dx}{2 b^3 \left (a^2-b^2\right )} \\ & = \frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \int \sec (c+d x) \, dx}{2 b^4}+\frac {\left (a^2 \left (2 a^2 A b-3 A b^3-3 a^3 B+4 a b^2 B\right )\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{b^4 \left (a^2-b^2\right )} \\ & = -\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^4 d}+\frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\left (a^2 \left (2 a^2 A b-3 A b^3-3 a^3 B+4 a b^2 B\right )\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b^5 \left (a^2-b^2\right )} \\ & = -\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^4 d}+\frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\left (2 a^2 \left (2 a^2 A b-3 A b^3-3 a^3 B+4 a b^2 B\right )\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^5 \left (a^2-b^2\right ) d} \\ & = -\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 b^4 d}+\frac {2 a^2 \left (2 a^2 A b-3 A b^3-3 a^3 B+4 a b^2 B\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^4 (a+b)^{3/2} d}+\frac {\left (2 a^2 A b-A b^3-3 a^3 B+2 a b^2 B\right ) \tan (c+d x)}{b^3 \left (a^2-b^2\right ) d}-\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) \sec (c+d x) \tan (c+d x)}{2 b^2 \left (a^2-b^2\right ) d}+\frac {a (A b-a B) \sec ^2(c+d x) \tan (c+d x)}{b \left (a^2-b^2\right ) d (a+b \sec (c+d x))} \\
\end{align*}
Mathematica [A] (verified)
Time = 7.04 (sec) , antiderivative size = 438, normalized size of antiderivative = 1.61
\[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=-\frac {2 a^2 \left (-2 a^2 A b+3 A b^3+3 a^3 B-4 a b^2 B\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2} \left (-a^2+b^2\right ) d}+\frac {\left (4 a A b-6 a^2 B-b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 b^4 d}+\frac {\left (-4 a A b+6 a^2 B+b^2 B\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 b^4 d}+\frac {B}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {B}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {A b \sin \left (\frac {1}{2} (c+d x)\right )-2 a B \sin \left (\frac {1}{2} (c+d x)\right )}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {A b \sin \left (\frac {1}{2} (c+d x)\right )-2 a B \sin \left (\frac {1}{2} (c+d x)\right )}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {-a^3 A b \sin (c+d x)+a^4 B \sin (c+d x)}{b^3 (-a+b) (a+b) d (b+a \cos (c+d x))}
\]
[In]
Integrate[(Sec[c + d*x]^4*(A + B*Sec[c + d*x]))/(a + b*Sec[c + d*x])^2,x]
[Out]
(-2*a^2*(-2*a^2*A*b + 3*A*b^3 + 3*a^3*B - 4*a*b^2*B)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(b^
4*Sqrt[a^2 - b^2]*(-a^2 + b^2)*d) + ((4*a*A*b - 6*a^2*B - b^2*B)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])/(2*
b^4*d) + ((-4*a*A*b + 6*a^2*B + b^2*B)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/(2*b^4*d) + B/(4*b^2*d*(Cos[(
c + d*x)/2] - Sin[(c + d*x)/2])^2) - B/(4*b^2*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2) + (A*b*Sin[(c + d*x)/
2] - 2*a*B*Sin[(c + d*x)/2])/(b^3*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])) + (A*b*Sin[(c + d*x)/2] - 2*a*B*Sin
[(c + d*x)/2])/(b^3*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])) + (-(a^3*A*b*Sin[c + d*x]) + a^4*B*Sin[c + d*x])/
(b^3*(-a + b)*(a + b)*d*(b + a*Cos[c + d*x]))
Maple [A] (verified)
Time = 1.53 (sec) , antiderivative size = 330, normalized size of antiderivative = 1.21
| | |
method | result | size |
| | |
derivativedivides |
\(\frac {-\frac {B}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 A b -4 B a -B b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-4 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}-\frac {2 a^{2} \left (\frac {a b \left (A b -B a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )}-\frac {\left (2 A \,a^{2} b -3 A \,b^{3}-3 B \,a^{3}+4 B a \,b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4}}+\frac {B}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 A b -4 B a -B b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (4 A a b -6 B \,a^{2}-b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}}{d}\) |
\(330\) |
default |
\(\frac {-\frac {B}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {2 A b -4 B a -B b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (-4 A a b +6 B \,a^{2}+b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}-\frac {2 a^{2} \left (\frac {a b \left (A b -B a \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )}-\frac {\left (2 A \,a^{2} b -3 A \,b^{3}-3 B \,a^{3}+4 B a \,b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{4}}+\frac {B}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {2 A b -4 B a -B b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (4 A a b -6 B \,a^{2}-b^{2} B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}}{d}\) |
\(330\) |
risch |
\(\text {Expression too large to display}\) |
\(1276\) |
| | |
|
|
|
[In]
int(sec(d*x+c)^4*(A+B*sec(d*x+c))/(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
[Out]
1/d*(-1/2*B/b^2/(tan(1/2*d*x+1/2*c)+1)^2-1/2*(2*A*b-4*B*a-B*b)/b^3/(tan(1/2*d*x+1/2*c)+1)+1/2/b^4*(-4*A*a*b+6*
B*a^2+B*b^2)*ln(tan(1/2*d*x+1/2*c)+1)-2*a^2/b^4*(a*b*(A*b-B*a)/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(tan(1/2*d*x+1/2*c
)^2*a-tan(1/2*d*x+1/2*c)^2*b-a-b)-(2*A*a^2*b-3*A*b^3-3*B*a^3+4*B*a*b^2)/(a-b)/(a+b)/((a-b)*(a+b))^(1/2)*arctan
h((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b))^(1/2)))+1/2*B/b^2/(tan(1/2*d*x+1/2*c)-1)^2-1/2*(2*A*b-4*B*a-B*b)/b^3/
(tan(1/2*d*x+1/2*c)-1)+1/2*(4*A*a*b-6*B*a^2-B*b^2)/b^4*ln(tan(1/2*d*x+1/2*c)-1))
Fricas [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 643 vs. \(2 (260) = 520\).
Time = 12.11 (sec) , antiderivative size = 1343, normalized size of antiderivative = 4.94
\[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display}
\]
[In]
integrate(sec(d*x+c)^4*(A+B*sec(d*x+c))/(a+b*sec(d*x+c))^2,x, algorithm="fricas")
[Out]
[1/4*(2*((3*B*a^6 - 2*A*a^5*b - 4*B*a^4*b^2 + 3*A*a^3*b^3)*cos(d*x + c)^3 + (3*B*a^5*b - 2*A*a^4*b^2 - 4*B*a^3
*b^3 + 3*A*a^2*b^4)*cos(d*x + c)^2)*sqrt(a^2 - b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2
*sqrt(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b
^2)) + ((6*B*a^7 - 4*A*a^6*b - 11*B*a^5*b^2 + 8*A*a^4*b^3 + 4*B*a^3*b^4 - 4*A*a^2*b^5 + B*a*b^6)*cos(d*x + c)^
3 + (6*B*a^6*b - 4*A*a^5*b^2 - 11*B*a^4*b^3 + 8*A*a^3*b^4 + 4*B*a^2*b^5 - 4*A*a*b^6 + B*b^7)*cos(d*x + c)^2)*l
og(sin(d*x + c) + 1) - ((6*B*a^7 - 4*A*a^6*b - 11*B*a^5*b^2 + 8*A*a^4*b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6*b - 4*A*a^5*b^2 - 11*B
*a^4*b^3 + 8*A*a^3*b^4 + 4*B*a^2*b^5 - 4*A*a*b^6 + B*b^7)*cos(d*x + c)^2)*log(-sin(d*x + c) + 1) - 2*(B*a^4*b^
3 - 2*B*a^2*b^5 + B*b^7 - 2*(3*B*a^6*b - 2*A*a^5*b^2 - 5*B*a^4*b^3 + 3*A*a^3*b^4 + 2*B*a^2*b^5 - A*a*b^6)*cos(
d*x + c)^2 - (3*B*a^5*b^2 - 2*A*a^4*b^3 - 6*B*a^3*b^4 + 4*A*a^2*b^5 + 3*B*a*b^6 - 2*A*b^7)*cos(d*x + c))*sin(d
*x + c))/((a^5*b^4 - 2*a^3*b^6 + a*b^8)*d*cos(d*x + c)^3 + (a^4*b^5 - 2*a^2*b^7 + b^9)*d*cos(d*x + c)^2)]
Sympy [F]
\[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=\int \frac {\left (A + B \sec {\left (c + d x \right )}\right ) \sec ^{4}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx
\]
[In]
integrate(sec(d*x+c)**4*(A+B*sec(d*x+c))/(a+b*sec(d*x+c))**2,x)
[Out]
Integral((A + B*sec(c + d*x))*sec(c + d*x)**4/(a + b*sec(c + d*x))**2, x)
Maxima [F(-2)]
Exception generated. \[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate(sec(d*x+c)^4*(A+B*sec(d*x+c))/(a+b*sec(d*x+c))^2,x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
for more de
Giac [A] (verification not implemented)
none
Time = 0.35 (sec) , antiderivative size = 384, normalized size of antiderivative = 1.41
\[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {4 \, {\left (3 \, B a^{5} - 2 \, A a^{4} b - 4 \, B a^{3} b^{2} + 3 \, A a^{2} b^{3}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{2} b^{4} - b^{6}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {4 \, {\left (B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (a^{2} b^{3} - b^{5}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}} - \frac {{\left (6 \, B a^{2} - 4 \, A a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{4}} + \frac {{\left (6 \, B a^{2} - 4 \, A a b + B b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{4}} - \frac {2 \, {\left (4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, A b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + B b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} b^{3}}}{2 \, d}
\]
[In]
integrate(sec(d*x+c)^4*(A+B*sec(d*x+c))/(a+b*sec(d*x+c))^2,x, algorithm="giac")
[Out]
-1/2*(4*(3*B*a^5 - 2*A*a^4*b - 4*B*a^3*b^2 + 3*A*a^2*b^3)*(pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(-2*a + 2*b) +
arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/((a^2*b^4 - b^6)*sqrt(-a^2 + b^2)
) - 4*(B*a^4*tan(1/2*d*x + 1/2*c) - A*a^3*b*tan(1/2*d*x + 1/2*c))/((a^2*b^3 - b^5)*(a*tan(1/2*d*x + 1/2*c)^2 -
b*tan(1/2*d*x + 1/2*c)^2 - a - b)) - (6*B*a^2 - 4*A*a*b + B*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^4 + (6*
B*a^2 - 4*A*a*b + B*b^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1))/b^4 - 2*(4*B*a*tan(1/2*d*x + 1/2*c)^3 - 2*A*b*tan(
1/2*d*x + 1/2*c)^3 + B*b*tan(1/2*d*x + 1/2*c)^3 - 4*B*a*tan(1/2*d*x + 1/2*c) + 2*A*b*tan(1/2*d*x + 1/2*c) + B*
b*tan(1/2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*b^3))/d
Mupad [B] (verification not implemented)
Time = 24.24 (sec) , antiderivative size = 6678, normalized size of antiderivative = 24.55
\[
\int \frac {\sec ^4(c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display}
\]
[In]
int((A + B/cos(c + d*x))/(cos(c + d*x)^4*(a + b/cos(c + d*x))^2),x)
[Out]
(atan(-((((8*tan(c/2 + (d*x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9*b^2 - 216*A*B^2*a^10*b - 3*A*B^2*a^2*b^9 + 3*A*B^2*a^3*b^8 - 63*A*B^2*a^4*b^7 + 15*A*
B^2*a^5*b^6 - 186*A*B^2*a^6*b^5 - 162*A*B^2*a^7*b^4 + 468*A*B^2*a^8*b^3 + 108*A*B^2*a^9*b^2 + 24*A^2*B*a^3*b^8
- 6*A^2*B*a^4*b^7 + 168*A^2*B*a^5*b^6 + 108*A^2*B*a^6*b^5 - 336*A^2*B*a^7*b^4 - 72*A^2*B*a^8*b^3 + 144*A^2*B*
a^9*b^2))/(a*b^11 + b^12 - a^2*b^10 - a^3*b^9) + (a^2*((a + b)^3*(a - b)^3)^(1/2)*((8*tan(c/2 + (d*x)/2)*(72*B
^2*a^10 + B^2*b^10 - 2*B^2*a*b^9 - 72*B^2*a^9*b + 16*A^2*a^2*b^8 - 32*A^2*a^3*b^7 + 20*A^2*a^4*b^6 + 64*A^2*a^
5*b^5 - 64*A^2*a^6*b^4 - 32*A^2*a^7*b^3 + 32*A^2*a^8*b^2 + 11*B^2*a^2*b^8 - 20*B^2*a^3*b^7 + 23*B^2*a^4*b^6 -
26*B^2*a^5*b^5 + 17*B^2*a^6*b^4 + 120*B^2*a^7*b^3 - 120*B^2*a^8*b^2 - 8*A*B*a*b^9 - 96*A*B*a^9*b + 16*A*B*a^2*
b^8 - 40*A*B*a^3*b^7 + 64*A*B*a^4*b^6 - 40*A*B*a^5*b^5 - 176*A*B*a^6*b^4 + 176*A*B*a^7*b^3 + 96*A*B*a^8*b^2))/
(a*b^8 + b^9 - a^2*b^7 - a^3*b^6) + (a^2*((8*(2*B*b^15 + 12*A*a^2*b^13 + 12*A*a^3*b^12 - 20*A*a^4*b^11 - 4*A*a
^5*b^10 + 8*A*a^6*b^9 + 6*B*a^2*b^13 - 16*B*a^3*b^12 - 14*B*a^4*b^11 + 28*B*a^5*b^10 + 6*B*a^6*b^9 - 12*B*a^7*
b^8 - 8*A*a*b^14))/(a*b^11 + b^12 - a^2*b^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